package com.two.shopping.controller;

import com.two.shopping.pojo.Result;
import com.two.shopping.pojo.User;
import com.two.shopping.service.IUserSetUPService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class UserSetUpController {
    @Autowired
    private IUserSetUPService userSetUPService;
    @CrossOrigin
    //Json形式
    @PutMapping("/update")
    public Result Update(@RequestBody User user) {
        log.info("修改用户信息，User对象接收,值为{}", user);
        userSetUPService.Update(user);
        return Result.success("修改成功");
    }
}


